Renames an existing file or directory.
既存のファイルおよびディレクトリの名前を変更します。
Name OldName As String As NewName As String
Name OldName As String As NewName As String
OldName, NewName: Any string expression that specifies the file name, including the path. You can also use URL notation.
OldName, NewName: ファイル名およびパスを指定する文字列表式。またURL 指定を用いることもできます。
Sub ExampleReName
Sub ExampleReName
On Error Goto Error
On Error Goto Error
Filecopy "c:\autoexec.bat", "c:\temp\autoexec.sav"
Filecopy "c:\autoexec.bat", "c:\temp\autoexec.sav"
Name "c:\temp\autoexec.sav" as "c:\temp\autoexec.bat"
"c:\temp\autoexec.sav" の名前を "c:\temp\autoexec.bat" とします。
end
End
Error:
Error:
if err = 58 then
if err = 58 then
msgbox "File already exists"
msgbox "File already exists"
end if
end if
end
End
end sub
end sub